<template>
  <el-card class="admin_header">
    <a href="/index">
      <img src="../../assets/icon/headIcon.png" alt="" width="55px" style="float: left;margin-top: -5px;">
    </a>
    <span style="font-size: 32px;font-weight: bold;position:absolute;left: 100px">BigData</span>
    <i class="el-icon-switch-button" v-on:click="logout" style="font-size: 40px;float: right"></i>
  </el-card>
</template>

<script>
export default {
  name: 'Header',
  methods: {
    async logout () {
      await this.$store.dispatch('logout')
      this.$message.successMessage('已登出')
      await this.$router.push('/login')
    }
  }
}
</script>

<style scoped>
  .admin_header {
    height: 80px;
    opacity: 0.85;
    line-height: 40px;
    min-width: 900px;
  }
  .el-icon-switch-button {
    cursor: pointer;
    outline:0;
  }
</style>
